package com.atguigu.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class OrderConfiguration {


    //  向IOC容器注册 远程调用的模板对象  可以实现远程调用RPC (基于http协议)
    @Bean
    @LoadBalanced  // 远程调用时支持负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
